package com.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@Scope("prototype")
public class Dog {
    @Value("牧羊犬")
    private String name;
   public Dog() {
        System.out.println("正在实例化dog");
    }
    @PostConstruct
    public void afterConstruct() {
       System.out.println("dog的afterConstruct方法成功");
    }
    public  void beforeDestroy() {
        System.out.println("准备销毁dog的beforeDestroy方法");
    }
   }

